/*
 * 
 * Copyright 2010 David H Pollack
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 * 
 * 
 */

package com.dhpollack.rotogss.data;

import java.util.Set;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;

/**
 * @author davidpl
 *
 */
@PersistenceCapable(detachable="true")
public class RotoGSSUsers {
	
    @PrimaryKey
    @Persistent
    private Key googleUserKey;
    
    @Persistent
    private Text yahooOAuthData;
    
    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private String googleAccessToken;
    
    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private String googleAccessTokenSecret;
    
    @Persistent
    private String googleMainFolder;

    @Persistent
    private Set<Key> yahooGames;
    
    @Persistent(mappedBy = "googleuserkey")
    @Element(dependent = "true")
    private Set<RotoGSSTeams> yahooTeams;

	public Key getGoogleUserKey() {
		return googleUserKey;
	}

	public void setGoogleUserKey(Key googleUserKey) {
		this.googleUserKey = googleUserKey;
	}

	public String getYahooOAuthData() {
		return yahooOAuthData.getValue();
	}

	public void setYahooOAuthData(String yahooOAuthData) {
		this.yahooOAuthData = new Text(yahooOAuthData);
	}

	public String getGoogleAccessToken() {
		return googleAccessToken;
	}

	public void setGoogleAccessToken(String googleAccessToken) {
		this.googleAccessToken = googleAccessToken;
	}

	public String getGoogleAccessTokenSecret() {
		return googleAccessTokenSecret;
	}

	public void setGoogleAccessTokenSecret(String googleAccessTokenSecret) {
		this.googleAccessTokenSecret = googleAccessTokenSecret;
	}

	public void setGoogleMainFolder(String googleMainFolder) {
		this.googleMainFolder = googleMainFolder;
	}

	public String getGoogleMainFolder() {
		return googleMainFolder;
	}

	public Set<Key> getYahooGamesTracked() {
		return yahooGames;
	}

	public void setYahooGamesTracked(Set<Key> yahooGames) {
		this.yahooGames = yahooGames;
	}

	public void addYahooGamesTracked(Key yahooGame) {
		this.yahooGames.add(yahooGame);
	}

	public void removeYahooGamesTracked(Key yahooGame) {
		this.yahooGames.remove(yahooGame);
	}

	public Set<RotoGSSTeams> getYahooTeamsTracked() {
		return yahooTeams;
	}

	public void setYahooTeamsTracked(Set<RotoGSSTeams> yahooTeams) {
		this.yahooTeams = yahooTeams;
	}
    
	public void addYahooTeamsTracked(RotoGSSTeams yahooTeam) {
		this.yahooTeams.add(yahooTeam);
	}
    
	public void removeYahooTeamsTracked(RotoGSSTeams yahooTeam) {
		this.yahooTeams.remove(yahooTeam);
	}
    
    
    


}
